package cn.erp.app.service;


import java.util.List;

import com.jfinal.plugin.activerecord.Page;

import cn.erp.common.model.SvcProduceCategory;

public class ProduceService {
	public static ProduceService me = new ProduceService();
	public Page<SvcProduceCategory> getAllWithPaginate(int pageNumber,int pageSize) {
		return SvcProduceCategory.dao.paginate(pageNumber, pageSize, "select *", "from svc_produce_category");
	}
	
	public List<SvcProduceCategory> getAll() {
		return SvcProduceCategory.dao.find("select * from svc_produce_category");
	}
	public Page<SvcProduceCategory> getBySearch(int pageNumber,int pageSize,String search) {
		search = "%"+search+"%";
		return SvcProduceCategory.dao.paginate(pageNumber, pageSize, "select *", "from svc_produce_category where produceName like ?",search);
	}
}
